﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ReportIncome.aspx.cs" Inherits="IHISCETeim.Web.MachineSys.FXModel.ReportIncome" %>

<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title>风险部汇总报表分析</title>
    <style type="text/css">
        html, body, div, span, applet, object, iframe,
        h1, h2, h3, h4, h5, h6, p, blockquote, pre,
        a, abbr, acronym, address, big, cite, code,
        del, dfn, em, font, img, ins, kbd, q, s, samp,
        small, strike, strong, sub, sup, tt, var,
        dl, dt, dd, ol, ul, li,
        fieldset, form, label, legend,
        table, caption, tbody, tfoot, thead, tr, th, td { padding:0; margin:0; font-size:12px; line-height:100%; font-family:Arial, sans-serif;}
        table{}
        .table{ border:1px solid #000; border-collapse:collapse;cursor:pointer;}
        .table th{ text-align:center; line-height:25px;border:1px solid #000; background-color:#F7F3F7;}
        .table td{ text-align:left; line-height:16px;border:1px solid #000; padding:2px;}
        .table tr.AlItemTr { background: none repeat scroll 0 0 #EFEFEF;}
        .table tr.SiItemTr{}
        .table tr.selectTr{background: none repeat scroll 0 0 #F78618;}
        .table tr.mouseoverTr{background: none repeat scroll 0 0 #FFCF6B;}
        .table tr.SumRow { font-weight:bold;}
        .table tr a{ color:Blue;}
        div.reportList{ line-height:21px;}
        div.reportList ul{ list-style-type:none; padding-left:12px;}
        div.reportList ul li{ list-style-type:none;  float:left; display:block; width:200px;display:block; margin:2px 10px 2px 2px; border:1px solid #ccc; padding:2px;} 
        div.reportList ul li.selected{ border:1px solid red!important; background-color:#ccc; }         
        div.reportList ul li a{ text-decoration: none;color: #000000; line-height:21px; height:21px;}
        div.reportList ul li a.selected{ color:Green;}
       
             
        div.topagentList{ line-height:18px;}
        div.topagentList ul{ list-style-type:none;}
        div.topagentList ul li{ list-style-type:none;   float:left; display:block; width:80px;display:block; margin:2px 10px 2px 2px; border:1px solid #ccc; padding:2px; } 
        div.topagentList ul li a{ text-decoration: none;color: #000000; line-height:18px; height:18px;}
        div.topagentList ul li.selected{ border:1px solid red!important; background-color:#ccc; }         
        div.topagentList ul li.selected a{color:red!important;}
        
    </style>
    <script src="../js/jquery-1.7.2.min.js" type="text/javascript"></script>
    <script type="text/javascript" src="../Highcharts/js/highcharts.js"></script>
    <script type="text/javascript" src="../Highcharts/js/modules/exporting.js"></script>
    <script>
        $(document).ready(function () {
            $("table.table").find("tbody tr").click(function () {
                var $tody = $(this).closest("tbody").find("tr").removeClass("selectTr");
                $(this).addClass("selectTr");
            }).mouseover(function () {
                var $tody = $(this).closest("tbody").find("tr").removeClass("mouseoverTr");
                $(this).addClass("mouseoverTr");
            }).mouseout(function () {
                var $tody = $(this).closest("tbody").find("tr").removeClass("mouseoverTr");

            })
        })
    </script>
</head>
<body style="">   
 <form id="form1" runat="server">
  
    <div style="padding:5px;margin:5px; border:1px solid #ccc;">
        <h2 style=" text-align:left; padding-left:12px; margin-bottom:5px;">管理费收益分析报表</h2>
        <div class="reportList">
            <ul>
                <li class="<%=(ReportType==1||ReportType==2)?"selected":"" %>"><a href="ReportIncome.aspx?rt=1" class="<%=(ReportType==1||ReportType==2)?"selected":"" %>">1.管理费收益分析报表(2008年至今)</a></li>
                <li class="<%=ReportType==3?"selected":"" %>"><a href="ReportIncome.aspx?rt=3" class="<%=ReportType==3?"selected":"" %>">2.管理费年度收益分析报表</a></li>
            </ul>
        </div>
        <div style=" clear:both;"></div>

    </div>
    <div style="border:1px solid #ccc;padding:5px; margin:5px;">  
    <%if (ReportType == 1)
      { %>        
        <table class="table" width="98%" >
        <thead>
            <tr  >  
                <th ></th>
                <th width="110px" align="center">经销商</th>                                   
                <th >管理费 </th>
                <th >GPS成本 </th>
                <th >GPS服务费 </th>
                <th >保险费支出 </th>
                <th >税金 </th>
                <th >净收入 </th>
                              
            </tr>
        </thead>
        <asp:repeater id="gv1" runat="server">
            <HeaderTemplate>            
            <tbody>
            </HeaderTemplate>
            <AlternatingItemTemplate>
                <tr class="AlItemTr">	
                    <td><%=tableRowIndex++ %></td>		
				    <td><a href="ReportIncome.aspx?rt=2&AliasName=<%# HttpUtility.UrlEncode(Eval("经销商").ToString()) %>"><%# Eval("经销商")%></td>
				    <td><%# FormatDecimalToStrings(Eval("管理费"), "N")%></td>
                    <td><%# FormatDecimalToStrings(Eval("GPS成本"), "N")%></td>    
                    <td><%# FormatDecimalToStrings(Eval("GPS服务费"), "N")%></td>
                    <td><%# FormatDecimalToStrings(Eval("保险费支出"), "N")%></td>
                    <td><%# FormatDecimalToStrings(Eval("税金"), "N")%></td>
                    <td><%# FormatDecimalToStrings(Eval("净收入"), "N")%></td>                           
			    </tr>
            </AlternatingItemTemplate>
            <ItemTemplate>
                <tr class="SiItemTr" >		
                     <td><%=tableRowIndex++ %></td>	
				    <td><a href="ReportIncome.aspx?rt=2&AliasName=<%# HttpUtility.UrlEncode(Eval("经销商").ToString()) %>"><%# Eval("经销商")%></td>
				    <td><%# FormatDecimalToStrings(Eval("管理费"),"N")%></td>
                    <td><%# FormatDecimalToStrings(Eval("GPS成本"),"N")%></td>    
                    <td><%# FormatDecimalToStrings(Eval("GPS服务费"),"N")%></td>
                    <td><%# FormatDecimalToStrings(Eval("保险费支出"),"N")%></td>
                    <td><%# FormatDecimalToStrings(Eval("税金"),"N")%></td>
                    <td><%# FormatDecimalToStrings(Eval("净收入"), "N")%></td>                           
			    </tr>
            </ItemTemplate>
            <FooterTemplate>
                <tr class="SumRow">
                    <td colspan="2">合计：</td>
                    <td><%# getsum("管理费")%></td>
                    <td><%# getsum("GPS成本")%></td>    
                    <td><%# getsum("GPS服务费")%></td>
                    <td><%# getsum("保险费支出")%></td>
                    <td><%# getsum("税金")%></td>
                    <td><%# getsum("净收入")%></td>  
                </tr>
                </tbody>                
            </FooterTemplate>
        </asp:repeater>
        </table>      
    <%} %>
    <%if (ReportType == 2)
      { %>
      <h2 style=" text-align:left; margin-bottom:5px;">
        <%=AliasName %>各年度净收入分析报表
        &nbsp;&nbsp;&nbsp;&nbsp;<a href="ReportIncome.aspx?rt=1">返回</a>
      </h2>
      
      <table class="table" width="98%" >
        <thead>
            <tr  >  
                <th >年份</th>                                    
                <th >管理费 </th>
                <th >GPS成本 </th>
                <th >GPS服务费 </th>
                <th >保险费支出 </th>
                <th >税金 </th>
                <th >净收入 </th>            
            </tr>
        </thead>
        <asp:repeater id="gv2" runat="server">
            <HeaderTemplate>            
            <tbody>
            </HeaderTemplate>
            <ItemTemplate>
                <tr target="sid_user" >			
				    <td><%# Eval("年份")%></td>
				    <td><%# FormatDecimalToStrings(Eval("管理费"),"N")%></td>
                    <td><%# FormatDecimalToStrings(Eval("GPS成本"),"N")%></td>    
                    <td><%# FormatDecimalToStrings(Eval("GPS服务费"),"N")%></td>
                    <td><%# FormatDecimalToStrings(Eval("保险费支出"),"N")%></td>
                    <td><%# FormatDecimalToStrings(Eval("税金"),"N")%></td>
                    <td><%# FormatDecimalToStrings(Eval("净收入"), "N")%></td>                           
			    </tr>
            </ItemTemplate>
            <FooterTemplate>
                </tbody>
                
            </FooterTemplate>
        </asp:repeater>
        </table>
      <div id="ReportType2container" style="width:97%; margin-top:5px;" >
                  
      </div>           
      <script type="text/javascript">
                    var chart;                    
                    $(document).ready(function () {
                        chart = new Highcharts.Chart({
                            chart: {
                                renderTo: 'ReportType2container',
                                type: 'column'
                            },
                            title: {
                                text: '<%=AliasName %>各年度净收入分析报表',
                                style :{
                                    color: '#3E576F',
	                                fontSize: '15px'
                                }
                            },
                            xAxis: {
                                categories:  <%=GetReport2JSCategories() %>
                            },
                            yAxis: {
                                title: {
                                    text: '年份'
                                }
                            },
                            tooltip: {
                               
                            },
                           
		                    plotOptions: {
                                spline: {
                                    dataLabels: {
					                    enabled: false,
                                        formatter: function() {
	                                        return this.y+'%';
                                        },
                                        enableMouseTracking: false
				                    },
                                    marker: {
                                        radius: 4,
                                        lineColor: '#666666',
                                        lineWidth: 1
                                    }
                                }
		                    },
                            series: <%=GetReport2JSSeries() %>
                        });
                    });


            </script>
      <%} %>
    
     <%if (ReportType == 3)
       { %>
       <asp:GridView ID="gv3" runat="server" CssClass="table" AutoGenerateColumns="true" Width="100%">
           </asp:GridView>
           <%=getdt3() %>
      <%} %>
    </div>
</form>
</body>
</html>